package com.csun.cmny.provider.model.dto;

import com.csun.cmny.provider.validator.ShiftLogDtoAddValid;
import com.csun.cmny.provider.validator.ShiftLogDtoEditValid;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

@Data
public class ShiftLogDto implements Serializable {

    private static final long serialVersionUID = -1346827324940343063L;
    /*
    * id
    * */
    @NotNull(message = "{shiftLog.id.empty}",groups = {ShiftLogDtoEditValid.class})
    private Long id;

    /**
     * 版本号
     */
    private Integer version;

    /**
     * 班次id
     */
    private Long shiftsId;

    /**
     * 护理人员 111011-111022-111033
     */
    private String user;

    /**
     * 护工姓名，多个用-隔开
     */
    private String realName;

    /**
     * 主要异常情况
     */
    private String mainExc;

    /**
     * 其他
     */
    private String other;

    /**
     * 时间 2018-04-13
     */
    @Pattern(regexp="^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])"
            + "|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|"
            + "[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$",
            message="{shiftlog.date.error}",
            groups = {ShiftLogDtoAddValid.class})
    @Pattern(regexp="^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])"
            + "|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|"
            + "[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$",
            message="{shiftlog.date.error}",
            groups = {ShiftLogDtoEditValid.class})
    private String date;

    /**
     * 护工组id
     */
    private Integer nursingGroupId;

    /*
    * 班次的具体时间 06:00:00-12:00:00——用来查询数据异常情况时使用
    * */
    private String shiftTime;

    private String month;
}
